<template>
  <div style="margin: auto;height: 400px;margin-top: 50px">
  <el-input
      v-model="textarea"
      maxlength="255"
      placeholder="Please input"
      show-word-limit
      type="textarea"
      style="width: 500px"
  />
    <br/>
  <el-button @click="submit" style="margin-top: 10px;">提交</el-button>
  </div>
</template>

<script>
import {ref} from "vue";
import API from "@/plugins/axiosInstanse";
import {ElMessage} from "element-plus";

export default {
  name: "FeedBack",
  setup(){
    const textarea = ref()
    const submit = () =>{
      API.get('api/feedBack',{
        params:{
          content : textarea.value
        }
      }).then((rsp)=>{
        if(rsp.Status){
          ElMessage({
            message: '提交成功',
            type: 'success',
          })
          textarea.value = ""
        }
        else{
            ElMessage({
              message: '提交失败',
              type: 'warning',
            })
          }
        })
    }
    return {
      submit,
      textarea
    }
  }

}
</script>

<style scoped>

</style>